define(function(require, exports, module) {
	var $ = require('jquery');
	var List = require('../util/list');
	require('../util/getURL.js');
	require('jbox');
	require('spin/1.3/spin.js');
	require('bootstrap/bootstrap/2.3.0/bootstrap.min');
	require('artTemplate/artTemplate/2.0.1/template.js');
	require('jquery/jquery-form/1.0.0/jquery.form.js');
	require('jquery/jquery-json/2.4.0/jquery.json.js');
	require('jquery/jquery-timeago/1.3.0/jquery.timeago.js');
	require('../util/tinymce-page.js');
	
	var flot = require('flot/flotr2');

	exports.options = {
		listLink : '',
		listParams : '',
		pageLink : '',
		pageParams : ''
	};
	var uid='';
	var pida = UrlParm.parm("id");
	if($g_user.login == 'true'){
		uid = ''+$g_user.id;
	}else{
		uid = '-1';
	}
	var commendTo = '';
	var status = '';
	var price='';
	var t = "1";
	var s="10";
	var buySum=$("#buyCount").val();
	
			
	//时间戳转换成日期
	exports.getLocalTime=function(now){ 
		var now=new Date(now);
        var year=now.getFullYear();     
        var month=now.getMonth()+1;     
        var date=now.getDate();     
        var hour=now.getHours();     
        var minute=now.getMinutes();     
        var second=now.getSeconds();   
        var ds=year+"-"+month+"-"+date+" "+hour+":"+minute+":"+second;
        return ds;
    }; 
  	
	$(document).ready(function(data) {
				/*exports.productsList();*/
				// 项目详情
				exports.options.projectCoverLink = $CONFIG.base_url
						+ "/api/preferential/get";
				exports.options.projectCoverPageParams = {
					"id" : pida,
					/*"uid" : uid*/
				};
				var goodsList = $.get(exports.options.projectCoverLink,
						exports.options.projectCoverPageParams);
				goodsList.done(function(data) {
					/*var start_pro_user_id=data.project.institution.user.id;
					if(start_pro_user_id!=uid){
						$("#tab-part5 #modal-67175").hide();
					}*/
					/*$("#commentCount em").text(data.project.commentCount);
					$("#attemtionCount em").text(data.project.attentionCount);
					$("#fundCount em").text(data.project.fundTarget);
					$("#getFound em").text(data.project.fundCurrent);
					$("#shareCount em").text(data.project.shareCount);*/
					$("#pre-time").text(data.createdDate);
					$("#pre-name").text(data.name);
					$("#insti-name").text(data.user.name);
					$("#project-title-top").show();
					
					/*var isAttention = data.project.isAttention;
					var isRecommended=data.project.isRecommended;
					if (isAttention == 1) {
						$('.attention-project-img').addClass("focus");
					}
					if (isRecommended == 1) {
						$('.support-project-img').addClass("recommend_focus");
					}*/
					pid = data.id;
					status = data.status;
					var result = {};
					result.preferential = data;
					//console.log(result);
					var selectKind = template.render(
							'projectCover-template', result);
					$('#projectCover').empty().append(selectKind);
					var selectKind2 = template.render(
							'introduceProject-template', result);
					$('#introduceProject').empty().append(selectKind2);

					/*var selectKind2 = template.render(
							'tabzfbTitle-template', data);
					$('#tabzfbTitle').empty().append(selectKind2);
*/
					/*var selectKind2 = template.render(
							'projectInfor-template', data);
					$('#projectInfor').empty().append(selectKind2);*/

					/*var selectKind2 = template.render(
							'preShow-template', data);
					$('#preShow').empty().append(selectKind2);

					var fundTarget = data.project.fundTarget;
					var fundCurrent = data.project.fundCurrent;
					var persent = fundCurrent / fundTarget;
					persent = Math.round(persent * 100 * 100) / 100;
					$("#projectInforBar div").css("width",
							persent + "%");
					$("#projectInforBar span").text(persent + "%");
					$("#projectInforBar div").css("width",
							persent + "%");
					$("#preShow .projectpledged").css("width",
							persent + "%");
					$(".persent").text(persent + "%");*/
				});

				
				
				
			});
});
